﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;

namespace IniTechCaash.Domain.Entities
{
    /// <summary>
    /// Logs activity of certain <see cref="Entitites"/>. 
    /// </summary>
    public class ActivityLog : Entity
    {
        [Required]
        [StringLength(256)]
        public string CreatedBy { get; set; }

        [Required]
        public DateTime LogDate { get; set; }

        [Required]
        [StringLength(256)]
        public string Message { get; set; }

        /// <summary>
        /// The PK Id of the <see cref="Entity"/> this log is associated with. 
        /// </summary>
        [Required]
        public int ObjectReferenceId { get; set; }

        /// <summary>
        /// The name of the type of <see cref="Entity"/> this log is associated with. Needed because these logs can be associated with 
        /// any type of <see cref="Entity"/>. 
        /// </summary>
        [Required]
        [StringLength(64)]
        public string ObjectReferenceType { get; set; }
    }
}
